package com.zdp;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <h1>网关路由配置</h1>
 */
@Configuration
public class RoutesConfiguration {

    @Bean
    public RouteLocator routes(RouteLocatorBuilder builder) {
        return builder.routes()
                .route(r -> r.path("/gateway/resource-center/user/user-info-by/authentication-center/check/token",
                                "/gateway/resource-center/user/user-info-by/parse/jwt/token")
                        .filters(f -> f.stripPrefix(1))
                        .uri("lb://RESOURCE-CENTER-JWT"))
                .build();
    }
}
